package com.pzb.wechat.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pzb.order.domain.OdOrderDetail;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * 用户优惠券对象 wechat_user_coupon
 * 
 * @author Mr_Wu
 * @date 2022-02-07
 */
public class WechatUserCoupon implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long id;

    /** 商户id */
    private String extAppid;

    /** 用户id */
    private String openid;

    /** 优惠券id */
    private Long couponId;

    private String couponName;

    /** 订单可使用金额 */
    private BigDecimal availableAmount;

    /** 优惠券类型   0元，1为件 */
    private String unit;

    /** 优惠券类型   0为代金券，1为折扣券 */
    private String type;

    /** 减免金额或折扣率，95折用0.95表示 */
    private BigDecimal deductionAmount;

    /** 可使用商品  0为全部商品，1为指定分类，2为指定商品 */
    private String availableGoods;

    /** 开始使用日期/领取日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;

    /** 过期日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /** 优惠券状态，0为未使用，1为已使用 */
    private String status;

    /** 优惠券指定商品分类 */
    private List<Long> classIds;

    /** 优惠券指定商品 */
    private List<Long> goodsIds;

    //暂存购物车可用商品  用来按比例分配优惠金额
    private List<OdOrderDetail> orderDetailList = new ArrayList<>();

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setExtAppid(String extAppid) 
    {
        this.extAppid = extAppid;
    }

    public String getExtAppid() 
    {
        return extAppid;
    }
    public void setOpenid(String openid) 
    {
        this.openid = openid;
    }

    public String getOpenid() 
    {
        return openid;
    }
    public void setCouponId(Long couponId) 
    {
        this.couponId = couponId;
    }

    public Long getCouponId() 
    {
        return couponId;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public BigDecimal getAvailableAmount() {
        return availableAmount;
    }

    public void setAvailableAmount(BigDecimal availableAmount) {
        this.availableAmount = availableAmount;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigDecimal getDeductionAmount() {
        return deductionAmount;
    }

    public void setDeductionAmount(BigDecimal deductionAmount) {
        this.deductionAmount = deductionAmount;
    }

    public String getAvailableGoods() {
        return availableGoods;
    }

    public void setAvailableGoods(String availableGoods) {
        this.availableGoods = availableGoods;
    }

    public void setBeginTime(Date beginTime)
    {
        this.beginTime = beginTime;
    }

    public Date getBeginTime() 
    {
        return beginTime;
    }
    public void setEndTime(Date endTime) 
    {
        this.endTime = endTime;
    }

    public Date getEndTime() 
    {
        return endTime;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public List<Long> getClassIds() {
        return classIds;
    }

    public void setClassIds(List<Long> classIds) {
        this.classIds = classIds;
    }

    public List<Long> getGoodsIds() {
        return goodsIds;
    }

    public void setGoodsIds(List<Long> goodsIds) {
        this.goodsIds = goodsIds;
    }

    public List<OdOrderDetail> getOrderDetailList() {
        return orderDetailList;
    }

    public void setOrderDetailList(List<OdOrderDetail> orderDetailList) {
        this.orderDetailList = orderDetailList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("extAppid", getExtAppid())
            .append("openid", getOpenid())
            .append("couponId", getCouponId())
            .append("beginTime", getBeginTime())
            .append("endTime", getEndTime())
            .append("status", getStatus())
            .toString();
    }
}
